package com.qk.mapper;

import com.qk.entity.Activity;
import com.qk.dto.ActivityDto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ActivityMapper {
    List<Activity> selectList(ActivityDto activityDto);
    @Delete("delete from activity where id=#{id}")
    void delete(Integer id);
    @Select("select id, channel, name, start_time, end_time, description, type, discount, voucher, create_time, update_time from activity where id=#{id}")
    Activity getActivityById(Integer id);

    void insert(Activity activity);

    void update(Activity activity);
    @Select("select id, channel, name, start_time, end_time, description, type, discount, voucher, create_time, update_time from activity where type=#{type}")
    List<Activity> listByType(Integer type);
}
